using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using TTQT;
using TTQT.TTQT_Code;

public partial class QuickHelpManagement : TTQT.MasterPage//: System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            DataAccessObject.instance().FillToListBox(cboPage.Items);
        }
    }
    protected void cboPage_SelectedIndexChanged(object sender, EventArgs e)
    {
        try
        {
            ds.SelectCommand = "Select noidung from QuickHelp where pageId=" + cboPage.SelectedValue;
            string noiDung = ((DataView)ds.Select(new DataSourceSelectArguments())).ToTable().Rows[0][0].ToString();
            fck.Value = noiDung;
        }
        catch (Exception ex)
        {

        }
    }
    protected void cmdUpdate_Click(object sender, EventArgs e)
    {
        try
        {
            ds.UpdateCommandType = SqlDataSourceCommandType.StoredProcedure;
            ds.UpdateCommand = "QuickHelp_update";
            ds.UpdateParameters.Clear();
            ds.UpdateParameters.Add(new Parameter("pageId"));
            ds.UpdateParameters["pageId"].DefaultValue = cboPage.SelectedValue;

            ds.UpdateParameters.Add(new Parameter("NoiDung"));
            ds.UpdateParameters["NoiDung"].DefaultValue = fck.Value;
            ds.Update();

        }
        catch (Exception exx)
        {
        }

    }
}
